<?php echo $this->fetch('header.html'); ?>
<div id="main" class="w-full">
    <div id="coupon" class="w">
        <?php echo $this->fetch('curlocal.html'); ?>
        <div class="store_coupon">
            <?php $_from = $this->_var['store_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'store');$this->_foreach['fe_store'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['fe_store']['total'] > 0):
    foreach ($_from AS $this->_var['store']):
        $this->_foreach['fe_store']['iteration']++;
?>
            <h2><a href="<?php echo url('app=store&act=coupon&id=' . $this->_var['store']['store_id']. ''); ?>"><?php echo $this->_var['store']['store_name']; ?></a></h2>
            <div class="coupon_list clearfix">
                <ul>
                    <?php $_from = $this->_var['store']['coupons']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'coupon');$this->_foreach['fe_coupon'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['fe_coupon']['total'] > 0):
    foreach ($_from AS $this->_var['coupon']):
        $this->_foreach['fe_coupon']['iteration']++;
?>
                    <li  <?php if ($this->_foreach['fe_coupon']['iteration'] % 4 == 0): ?>class="last"<?php endif; ?>>
                        <a href="<?php echo url('app=coupon&act=view&id=' . $this->_var['coupon']['coupon_id']. ''); ?>" target="_blank">
                            <img class="lazyload"  initial-url="<?php echo htmlspecialchars($this->_var['coupon']['coupon_bg']); ?>" width="258" height="160">
                            <p class="name" ><?php echo $this->_var['coupon']['coupon_name']; ?></p>
                            <p class="price" >
                                <?php if ($this->_var['coupon']['coupon_value']): ?>满<?php echo price_format($this->_var['coupon']['min_amount']); ?>可抵扣<?php echo price_format($this->_var['coupon']['coupon_value']); ?><?php else: ?>不限制<?php endif; ?>
                            </p>
                            <p class="time" ><?php echo local_date("Y-m-d",$this->_var['coupon']['start_time']); ?> 至 <?php if ($this->_var['coupon']['end_time']): ?><?php echo local_date("Y-m-d",$this->_var['coupon']['end_time']); ?><?php else: ?>不限制<?php endif; ?></p>
                        </a>
                    </li>
                    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                </ul>
            </div>
            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        </div>
        <?php echo $this->fetch('page.bottom.html'); ?>
    </div>
</div>
<?php echo $this->fetch('footer.html'); ?>